package com.joesem.sale.client.getui

import android.os.Parcel
import android.os.Parcelable


data class NoticeMode(
    val content: String? = "",
    val `data`: NoticeDataMode? = NoticeDataMode(),
    val title: String? = ""
)

data class NoticeDataMode(
    val business_id: String? = "",
    val content: String? = "",
    val notify_id: Int? = 0,
    val notify_type: String? = "",
    val title: String? = ""
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(business_id)
        parcel.writeString(content)
        parcel.writeInt(notify_id ?: 0)
        parcel.writeString(notify_type)
        parcel.writeString(title)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<NoticeDataMode> {
        override fun createFromParcel(parcel: Parcel): NoticeDataMode {
            return NoticeDataMode(parcel)
        }

        override fun newArray(size: Int): Array<NoticeDataMode?> {
            return arrayOfNulls(size)
        }
    }
}